package com.learn.iot.aspect;

import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyAspect {

//	@Pointcut("execution(* com.learn.iot.service..*.*(..))")
	@Pointcut("@annotation(com.learn.iot.annotation.MyAnnotation) && !pointCut1()")
	public void pointCut(){}

	@Pointcut("execution(* com.learn.iot.service.TestService.*(java.lang.String))")
	public void pointCut1(){}

	@Before("pointCut()")
	public void serviceBeforeLog(){
		System.out.println("aop before Log");
	}

//	@Around("pointCut()")
	public void serviceAroundLog(){
		System.out.println("aop around Log");
	}

}
